package main

import (
	"google.golang.org/grpc"
	"grpcpro/helper"
	"grpcpro/services"
	"log"
	"net"
)
const (
	// Address gRPC服务地址
	Address = "127.0.0.1:8888"
)
func main() {
	rpcServer := grpc.NewServer(grpc.Creds(helper.GetServeCreds())) //实例化grpc Server
	//创建带ca证书验证的服务端
	services.RegisterProdServiceServer(rpcServer,new(services.ProdService))
	listen, _ := net.Listen("tcp",Address) //设置传输协议和监听地址
	log.Println("Listen on " + Address + " with TLS")
	rpcServer.Serve(listen)
}
